<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,user-scalable=no,minimal-ui">
        <meta name="description" content="">
        <meta name="author" content="">
        <link rel="icon" href="../img/asset-favico.ico">
        <title>传智健康</title>
        <link rel="stylesheet" href="../css/page-health-index.css" />
        <link rel="stylesheet" href="../css/page-health-orderInfo.css">
        <link rel="stylesheet" href="../plugins/elementui/index.css" />
        <script src="../plugins/datapicker/datePicker.js"></script>
        <script src="../plugins/jquery/dist/jquery.min.js"></script>
        <script src="../plugins/healthmobile.js"></script>
        <script src="../plugins/vue/vue.js"></script>
        <script src="../plugins/vue/axios-0.18.0.js"></script>
        <script src="../plugins/elementui/index.js"></script>
        <script>
            var id = getUrlParam("id");//预约id
        </script>
    </head>
    <body data-spy="scroll" data-target="#myNavbar" data-offset="150">
        <div class="app" id="app">
            <!-- 页面头部 -->
            <div class="top-header">
                <span class="f-left"><i class="icon-back" onclick="history.go(-1)"></i></span>
                <span class="center">传智健康</span>
            </div>
            <!-- 页面内容 -->
            <div class="contentBox">
                <div class="form-info">
                    <form class="info-form">
                        <div class="date">
                            <label>开始时间</label>
                            <i class="icon-date" class="picktime"></i>
                            <input id="starttime" v-model="starttime" type="text" class="picktime">
                            <br/>
                            <label>结束时间</label>
                            <i class="icon-date" class="picktime2"></i>
                            <input id="endtime" v-model="endtime" type="text" class="picktime2">
                            <el-row>
                                <el-col :span="24" :offset="10">
                                    <el-button type="primary" plain @click="select">查询</el-button>
                                </el-col>
                            </el-row>
                        </div>
                    </form>
                </div>
                <div class="list-column2">
                    <ul class="list" v-for="setmeal in setmealList">
                        <li class="type-item" style="width: 100%" @click="changeurl(setmeal)">
                            <a class="link-page">
                                <div class="type-title">
                                    <h3>预约人：{{setmeal.name}}</h3>
                                    <p>套餐性别要求：{{setmeal.sex == '0' ? '不限' : setmeal.sex == '1' ? '男':'女'}}</p>
                                    <p>套餐名：{{setmeal.setmealname}}</p>
                                    <p>预约日期：{{setmeal.date}}}</p>
                                </div>
                                <div class="type-icon">
                                    查看
                                </div>
                            </a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        <script>
            var vue = new Vue({
                el: '#app',
                data:{
                    starttime:'',
                    endtime:'',
                    setmealList:[]
                },
                methods:{
                    select(){
                        //根据日期查询所有预约
                        axios.get("/order/findAllOrderByDate.do?starttime="+this.starttime+"&endtime="+this.endtime).then((resp)=>{
                            if (resp.data.flag){
                                this.setmealList=resp.data.data;
                            }
                        })
                    },
                    changeurl(rows){
                        window.location.href="ordersetting.html?id="+rows.id;
                    }
                }
            });
        </script>
        <script>
            //日期控件
            var calendar = new datePicker();
            calendar.init({
                'trigger': '.picktime',/*按钮选择器，用于触发弹出插件*/
                'type': 'date',/*模式：date日期；datetime日期时间；time时间；ym年月；*/
                'onSubmit': function() { /*确认时触发事件*/
                    //var theSelectData = calendar.value;
                },
                'onClose': function() { /*取消时触发事件*/ }
            });
        </script>
        <script>
            //日期控件
            var calendar = new datePicker();
            calendar.init({
                'trigger': '.picktime2',/*按钮选择器，用于触发弹出插件*/
                'type': 'date',/*模式：date日期；datetime日期时间；time时间；ym年月；*/
                'onSubmit': function() { /*确认时触发事件*/
                    //var theSelectData = calendar.value;
                },
                'onClose': function() { /*取消时触发事件*/ }
            });
        </script>
    </body>
</html>